{-# OPTIONS_GHC
    -XTypeSynonymInstances
    -XMultiParamTypeClasses          #-}
module Types where

import Relational

data Language = English | Spanish | Russian | Hungarian
    deriving (Show,Read,Eq,Ord)

newtype Expression = Expression String
    deriving (Show,Read,Eq,Ord)
    
newtype Utterance = Utterance String
    deriving (Show,Read,Eq,Ord)
    
newtype ExprEq = ExprEq String
    deriving (Show,Read,Eq,Ord)
    

instance Homomorphism String Expression   where χ x = Expression x
instance Homomorphism Expression String   where χ (Expression x) = x
instance Homomorphism String ExprEq       where χ x = ExprEq x
instance Homomorphism ExprEq String       where χ (ExprEq x) = x
instance Homomorphism Expression ExprEq   where χ (Expression x) = ExprEq x
instance Homomorphism ExprEq Expression   where χ (ExprEq x) = Expression x

instance Homomorphism String Utterance    where χ x = Utterance x
instance Homomorphism Utterance String    where χ (Utterance x) = x
